package com.ty.skysystem.entity.vo;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import lombok.Data;

/** @author Mjg @QQ:2091864671 @Creates by mjg ON 2020/12/22-12:37 */
@Data
public class MenuNodeVO {
  private Integer menuId;

  private String menuName;

  private String menuPath = null;

  private Integer type;

  private Integer orderNum;

  private Integer disabled;

  private String open;

  private String menuIcon;

  private Integer parentId;
  private List<MenuNodeVO> children = new ArrayList<>();
  /*
   * 排序,根据order排序
   */
  public static Comparator<MenuNodeVO> order() {
    return (o1, o2) -> {
      if (o1.getOrderNum() != o2.getOrderNum()) {
        return o1.getOrderNum() - o2.getOrderNum();
      }
      return 0;
    };
  }
}
